<?php
declare (strict_types=1);

namespace app\time\controller;

use addons\OssBackup\facade\OssBackup;
use app\common\model\Statistics;
use app\common\tool\Result;
use think\Response;

class Index
{
    /**
     * 自动备份
     * 每天23点55分执行一次
     */
    public function autoBackup(): Response
    {
        $result = OssBackup::auto();

        return Result::fastReturn($result);
    }

    /**
     * 更新统计
     * 每天0点执行一次
     */
    public function statistics(): Response
    {
        $result = Statistics::_timing();

        return Result::fastReturn($result);
    }
}